<template>
	<view class="banner h-[200rpx] mx-[30rpx] translate-y-0">
		<swiper class="swiper h-full" :indicator-dots="banner.length > 0" indicator-active-color="#4173ff"
			:autoplay="true">
			<swiper-item v-for="(item, index) in banner" :key="index" @click="handleClick(item.link)">
				<u-image mode="aspectFit" width="100%" height="100%" :src="item.image" />
			</swiper-item>
		</swiper>
	</view>
</template>

<script setup lang="ts">
	import { useAppStore } from '@/stores/app'
	import { navigateTo,jumpTo } from '@/utils/util'

	const props = defineProps({
		banner: {
			type: Object,
			default: () => ({})
		},
		styles: {
			type: Object,
			default: () => ({})
		}
	})
	const { getImageUrl } = useAppStore()
	const handleClick = (link : any) => {
		let linkArr = {}
		if (link.indexOf('http') == 0) {
			jumpTo(link)
		} else {
			linkArr = { path: link }
		}
		if(link.indexOf('/pages/team/index') == 0){
			navigateTo(linkArr, 'switchTab')
		}else{
			navigateTo(linkArr)
		}
	}
</script>

<style></style>